class GrassRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;
	Point2i TexturePosition;

	GrassRenderer(ITexture *texture, const Point2i &position) :
		Texture(texture),
		TexturePosition(position)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		const Block &above = schematic->GetBlock(position.X, position.Y + 1, position.Z);

		if (above != Block::Empty &&
			(above.ID == 78 || above.ID == 80))
			renderer->Draw(Box(Texture).SetAll(Point2i(4 * 16, 4 * 16)).SetBottom(Point2i(2 * 16, 0)).SetTop(Point2i(2 * 16, 4 * 16)));
		else
		{
			renderer->Draw(Box(Texture).SetAll(Point2i(6 * 16, 2 * 16), Colorb(73, 205, 51, 255)).SetTop(Point2i(0, 0), Colorb(73, 205, 51, 255)).SetBottom(Point2i(0, 0), Colorb(0, 0, 0, 0)));
			renderer->Draw(Box(Texture).SetAll(Point2i(2 * 16, 0)));
		}
	}
};